package com.sc.nft.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.DepositWithdrawalRecordPayStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class WithdrawOrRechargeRecordVO {

    @ApiModelProperty("金额")
    private BigDecimal amount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("金额")
    private String amountString;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("时间")
    private Date createTime;

    @ApiModelProperty("状态")
    private DepositWithdrawalRecordPayStatusEnum payStatus;

    @ApiModelProperty("提现失败原因")
    private String cause;


    public void setAmount(BigDecimal amount) {
        this.amount = amount;
        this.amountString = amount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }
}
